Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cDAC] SOSDacImpl::GetMethodDescData DynamicMethodObject #110545

Merged
merged 6 commits into from
Dec 11, 2024

Conversation

max-charlamb
Copy link
Contributor

@max-charlamb max-charlamb commented Dec 9, 2024

Contributes to #109426

Previously the cDAC version of GetMethodDescData would throw if a method is dynamic because fetching the managedDynamicMethodObject was not supported. The managedDynamicMethodObject is a small portion of the returned information for dynamic methods and is unused in both SOS and CLRMD.

Since it is a relatively large lift to access this field (on a CorLib bound managed object) I believe it is reasonable to leave this field blank for now. Due to compatibility with the legacy implementation we need to keep the return object the same so the field is zero'd out.

Copy link
Contributor

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

@@ -405,7 +405,8 @@ int ISOSDacInterface.GetMethodDescData(ulong methodDesc, ulong ip, DacpMethodDes
Debug.Assert(data->MDToken == dataLocal.MDToken);
Debug.Assert(data->GCInfo == dataLocal.GCInfo);
Debug.Assert(data->GCStressCodeCopy == dataLocal.GCStressCodeCopy);
Debug.Assert(data->managedDynamicMethodObject == dataLocal.managedDynamicMethodObject);
// managedDynamicMethodObject is not currently populated by the cDAC API and may differ from legacyImpl.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the managedDynamicMethodObject field actually zero'ed? I don't see it anywhere. I'm not sure if you should rely on the client to zero it (like in dacprivate.h). It may not be enough i.e. CLRMD doesn't use that include file.

Copy link
Contributor Author

@max-charlamb max-charlamb Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I wasn't sure if the return memory region would be zero'd to begin with, but that makes sense. I'll zero out the field to make sure it is always returned with 0.

@max-charlamb
Copy link
Contributor Author

/ba-g Build analysis blocked by #110285

@max-charlamb max-charlamb merged commit cf03276 into dotnet:main Dec 11, 2024
145 of 147 checks passed
hez2010 pushed a commit to hez2010/runtime that referenced this pull request Dec 14, 2024
* allow SOSDacImpl::GetMethodDescData to handle dynamic functions
* zero-out managedDynamicMethodObject as it is not being used and cDAC does not yet support fetching managed fields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants